import axios from "axios";
export const getBannerData = (data) => {
  return {
    type   : "HOMEBANNER",
    payload: data
  };
};

export const getBanner = () => {
    console.log(333)
  return dispatch => {
    axios({
      url   : "http://116.62.215.63/shop/content/ppt",
      method: "get"
    }).then(res => {
      dispatch(getBannerData(res.data.data));
    });
  };
};


export const getHotData = (data) => {
  return {
    type   : "HOMEHOT",
    payload: data
  };
};

export const getHot = () => {
  console.log('getHot')
  return dispatch => {
    axios({
      url   : "http://116.62.215.63/shop/product/Stars",
      method: "get"
    }).then(res => {
      dispatch(getHotData(res.data.data));
    });
  };
};